//package com.trip.driver.consumer;
//
//import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
//import org.apache.rocketmq.common.consumer.ConsumeFromWhere;
//import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
//import org.apache.rocketmq.spring.core.RocketMQListener;
//import org.apache.rocketmq.spring.core.RocketMQPushConsumerLifecycleListener;
//import org.springframework.stereotype.Component;
//
//@Slf4j
//@Component
//@RocketMQMessageListener(topic = "order-pool",consumerGroup = "consumer-demo1")
//public class OrderConsumer implements RocketMQListener<String> , RocketMQPushConsumerLifecycleListener {
//
//    @Override
//    public void onMessage(String message) {
//        log.info("Receive message: {}  ThreadName: {}", message, Thread.currentThread().getName());
//    }
//
//    @Override
//    public void prepareStart(DefaultMQPushConsumer consumer) {
//        consumer.setMaxReconsumeTimes(0);
//        consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_LAST_OFFSET);
//    }
//}
